﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using nwrole.toolbox.sync;


namespace sync_test.maps
{
    public class SYNCENTITY
    {
        public static SyncMap Mapping
        {
            get
            {
                var map = new SyncMap();

                map.Name = "SyncEntity";
                map.SourceTableName = "SYNCENTITY";
                map.ShadowTableName = "SYNCENTITY";
                map.DestinationTableName = "SYNCENTITY";

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "Id",
                        CSharpType = "System.Decimal",
                        PrimaryKey = true,
                        SourceSqlTypeName = "NUMBER",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "Name",
                        CSharpType = "System.String",
                        SourceSqlTypeName = "VARCHAR2(80 BYTE)",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "SourceTableName",
                        CSharpType = "System.String",
                        SourceSqlTypeName = "VARCHAR2(80 BYTE)",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "ShadowTableName",
                        CSharpType = "System.String",
                        SourceSqlTypeName = "VARCHAR2(80 BYTE)",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "DestinationTableName",
                        CSharpType = "System.String",
                        SourceSqlTypeName = "VARCHAR2(80 BYTE)",
                        SourceSqlTypeNullableBool = false,
                        DestSqlTypeName = "int",
                        DestSqlTypeNullableBool = false,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "CREATE_TIMESTAMP",
                        CSharpType = "System.DateTime",
                        SourceSqlTypeName = "DATE",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "datetime2(7)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                map.AddColumn(
                    new SyncMapColumn()
                    {
                        ColumnName = "UPDATE_TIMESTAMP",
                        CSharpType = "System.DateTime",
                        SourceSqlTypeName = "DATE",
                        SourceSqlTypeNullableBool = true,
                        DestSqlTypeName = "decimal(12,2)",
                        DestSqlTypeNullableBool = true,
                    }
                );

                return map;
            }
        }
    }
}
